/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Frame_petugas.java
 *
 * Created on Oct 7, 2012, 3:04:11 PM
 */
package View;

import Controller.ControlData;
import java.awt.Desktop;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;

/**
 *
 * @author a9uszT
 */
public class Frame_dokter extends javax.swing.JFrame {

    /**
     * Creates new form Frame_petugas
     */
    public Frame_dokter() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        Nama_label = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        MenuUtama = new javax.swing.JMenu();
        RekamMedisMenu = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        exit_JM = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        Bantuan = new javax.swing.JMenuItem();
        about = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jPanel1.setBackground(new java.awt.Color(51, 51, 255));
        jPanel1.setForeground(new java.awt.Color(0, 126, 146));
        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 24));
        jLabel1.setText("Selamat Datang");
        jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 90, -1, -1));

        jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/picture/usd.gif"))); // NOI18N
        jPanel1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 160, 720, 140));

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 28));
        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel2.setText("Sistem Informasi Rekam Medis");
        jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 350, 710, -1));

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 28));
        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel3.setText("Yogyakarta");
        jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 440, 710, -1));

        jLabel4.setFont(new java.awt.Font("Elephant", 1, 24));
        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel4.setText("Dokter");
        jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 10, 720, -1));

        Nama_label.setFont(new java.awt.Font("Tahoma", 1, 24));
        Nama_label.setText("name");
        jPanel1.add(Nama_label, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 90, -1, -1));

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 28));
        jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel6.setText("Poliklinik Universitas Sanata Dharma");
        jPanel1.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 400, 710, -1));

        MenuUtama.setMnemonic('R');
        MenuUtama.setText("Menu");
        MenuUtama.setFont(new java.awt.Font("Segoe UI", 1, 14));
        MenuUtama.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuUtamaActionPerformed(evt);
            }
        });

        RekamMedisMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.CTRL_MASK));
        RekamMedisMenu.setFont(new java.awt.Font("Segoe UI", 1, 14));
        RekamMedisMenu.setText("RekamMedis");
        RekamMedisMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RekamMedisMenuActionPerformed(evt);
            }
        });
        MenuUtama.add(RekamMedisMenu);
        MenuUtama.add(jSeparator1);

        exit_JM.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.CTRL_MASK));
        exit_JM.setFont(new java.awt.Font("Segoe UI", 1, 14));
        exit_JM.setText("Logout");
        exit_JM.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exit_JMActionPerformed(evt);
            }
        });
        MenuUtama.add(exit_JM);

        jMenuBar1.add(MenuUtama);

        jMenu2.setText("Help");
        jMenu2.setFont(new java.awt.Font("Segoe UI", 1, 14));

        Bantuan.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
        Bantuan.setFont(new java.awt.Font("Segoe UI", 1, 14));
        Bantuan.setText("Bantuan");
        Bantuan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BantuanActionPerformed(evt);
            }
        });
        jMenu2.add(Bantuan);

        about.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F2, 0));
        about.setFont(new java.awt.Font("Segoe UI", 1, 14));
        about.setText("about program");
        about.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aboutActionPerformed(evt);
            }
        });
        jMenu2.add(about);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 496, Short.MAX_VALUE)
        );

        pack();
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        java.awt.Dimension dialogSize = getSize();
        setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
    }// </editor-fold>//GEN-END:initComponents

    private void exit_JMActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exit_JMActionPerformed
        JOptionPane.showMessageDialog(rootPane, "selesai ");
        dispose();
        disable();
    }//GEN-LAST:event_exit_JMActionPerformed

    private void MenuUtamaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MenuUtamaActionPerformed
    }//GEN-LAST:event_MenuUtamaActionPerformed

    private void RekamMedisMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RekamMedisMenuActionPerformed
//        try {
//            RekamMedis rm = new RekamMedis();
//            rm.setVisible(true);
//            RekamMedis.anamnesa_button.setVisible(false);
//            RekamMedis.diagnosa_button.setEnabled(false);
//            String nama = Nama_label.getText();
//            String kode = ControlData.getKoneksi().cariKodeDokter(nama);
//            RekamMedis.idDokterRM.setText(kode);
//            RekamMedis.namaDokter.setText(nama);
//            RekamMedis.LDOC.setVisible(true);
//            RekamMedis.idDokterRM.setVisible(true);
//            RekamMedis.namaDokter.setVisible(true);
//        } catch (Exception ex) {
//            Logger.getLogger(Frame_petugas.class.getName()).log(Level.SEVERE, null, ex);
//        }
    }//GEN-LAST:event_RekamMedisMenuActionPerformed

    private void BantuanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BantuanActionPerformed
        try {
            Desktop.getDesktop().open(new File("user Manual.chm"));
        } catch (IOException ex) {
            Logger.getLogger(Frame_petugas.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_BantuanActionPerformed

    private void aboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutActionPerformed
       JOptionPane.showMessageDialog(rootPane, " copyright 2012 by kelompok 3");
    }//GEN-LAST:event_aboutActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Menu_Utama.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Menu_Utama.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Menu_Utama.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Menu_Utama.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new Frame_dokter().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem Bantuan;
    private javax.swing.JMenu MenuUtama;
    public static javax.swing.JLabel Nama_label;
    private javax.swing.JMenuItem RekamMedisMenu;
    private javax.swing.JMenuItem about;
    private javax.swing.JMenuItem exit_JM;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    // End of variables declaration//GEN-END:variables
}
